{layout name="public/layout" /}
{include file='yxnavbar'}
<style type="text/css">
    .exclusive-image  li{
        list-style: none;
        display: inline-block;
        height: 340px;/*当图片尺寸不一的时候，设置一个高度*/
        width: 170px;/*三列图片排列*/
        /*三列图片排列*/
        text-align: center;
        /*内容居中*/
        overflow: hidden;
        /*超出隐藏*/
        vertical-align: bottom;
        /*内容底部对齐*/
    }
    .img-content {
        width: 96%;
        padding: 5px 0;
        overflow: hidden;
    }

    .img-wrap {
        padding: 10px;
        background-color: #fff;
        border: 1px solid #ccc;
    }

    .img-box {
        height: 260px;
        overflow: hidden;
    }
    .img-box img {
        position: relative;
        width: 100%;
        top: 50%;
        transform: translateY(-50%);
    }
    .title{
        font-size: 12px;
        color: #454545;
        height: 18px;
        overflow: hidden;
    }
    .title2{
        font-size: 12px;
        color: #cb2c01;
        font-weight: 800;
    }
    .red_font{
        color: red;
    }
    .title3{
        font-size: 12px;
        color: #3f8cfe;
    }
    .title4{
        font-size: 12px;
        color: #f25b9b;
    }


</style>
<div class="main">
    <div class="panel panel-default" role="tabpanel">
        <div class="panel-heading">基本信息</div>
        <div class="panel-body">
            <form>
                

                <div class="form-group">
                    <div class="col-sm-8 col-xs-12">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">活动标题</label>
                            <div class="col-sm-8 col-xs-12">
                                <input type="text" class="form-control" placeholder="" readonly name="softname" value="{$theme['title']}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店</label>
                            <div class="col-sm-8 col-xs-12">
                                <input type="text" class="form-control" placeholder="" readonly name="xc_group_name" value="{php echo $config['province'] . $config['city'] . $config['district'] . ' '. $theme['jubf'];}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">老师</label>
                            <div class="col-sm-8 col-xs-12">
                                <input type="text" class="form-control" placeholder="" readonly name="xc_name" value="{$theme['laoshi']}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">销售</label>
                            <div class="col-sm-8 col-xs-12">
                                <input type="text" class="form-control" placeholder="" readonly name="xc_name" value="{$theme['xiaoshou']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">客服</label>
                            <div class="col-sm-8 col-xs-12">
                                <input type="text" class="form-control" placeholder="" readonly name="xc_name" value="{$theme['kefu']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">操作日志</label>
                            <div class="col-sm-8 col-xs-12">
                                <div class="help-block">{$result['image_record_remark']}</div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-4 col-xs-12">
                        <img style="width: 200px; position: fixed;right: 35px;z-index: 10;" src="{$theme['headimg']}">
                    </div>

                </div>

            </form>
        </div>
    </div>
    <div class="panel panel-default" role="tabpanel">
        <div class="panel-heading">相似专版【<span style="color: #ff0000">{php echo count($exclusive['imgs']);}</span>个】</div>
        <div class="panel-body">
            <div class="form-group">
                <div class="col-xs-12 exclusive-image" >
                    <ul id="exclusive_image" style="margin-right: 200px;">
                        {loop $exclusive['imgs'] $row}
                        <li>
                            <div class="img-content">
                                <div class="img-box">
                                    <img src="{$row['headimg']}"></div>
                            </div>
                            <div class="title">{$row['shopname']}</div>
                            <div class="title">{$row['shejishi']} <span class="title4">{$row['xiuchanggs']}</span> <span class="title3">{$row['xiaoshou']}</span></div>
                            {if $row['score']>$max_score}
                            <div class="title">相似度：<span class="title2">{$row['score']}%</span></div>
                            {else}
                            <div class="title">相似度：<span class="title">{$row['score']}%</span></div>
                            {/if}
                            <div class="title">专版时间：<span class="title">{$row['create_time']}</span></div>

                        </li>
                        {/loop}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="panel panel-default" role="tabpanel">
        <div class="panel-heading">同地区进行中的活动【<span style="color: #ff0000">{php echo count($city_list);}</span>个】</div>
        <div class="panel-body">
            <div class="form-group">
                <div class="col-xs-12 exclusive-image" >
                    <ul id="exclusive_image" style="margin-right: 200px;">
                        {loop  $city_list $row}
                        <li>
                            <div class="img-content">
                                <div class="img-box">
                                    <img src="{$row['headimg']}"></div>
                            </div>
                            <div class="title">{$row['shopname']}</div>
                            <div class="title">{$row['district']} <span class="title4">{$row['xiuchanggs']}</span> <span class="title3">{$row['xiaoshou']}</span></div>
                            {if $row['endtime']>time()}
                            <div class="title">进行中：<span class="title2">{php echo date('Y-m-d', $row['endtime']);}</span></div>
                            {else}
                            <div class="title">结束：<span class="title">{php echo date('Y-m-d', $row['endtime']);}</span></div>
                            {/if}
                        </li>
                        {/loop}
                    </ul>
                </div>
            </div>
        </div>
    </div>


    <div class="form-group" id="sub_upload" >
        <div class="col-sm-12">
            {if ($exclusive['max_score']<$max_score || $zhuanbangs == $themegs) && $theme['softsn_status']!=0}
            <a class="btn btn-success col-lg-3" href="{php echo createWebUrl('theme_softsn',array('op'=>'confirm','themeid'=>$themeid,'status'=>$status));}">{if $zhuanbangs == $themegs && !empty($themegs)}专版秀场公司自用，{/if}确认同地区无冲突</a>
            {elseif $theme['softsn_status']!=1}
            <input  id="btnPass" type="button" value="{$softsn_tips[$theme['softsn_status']]}" class="btn btn-default col-lg-2" disabled>
            {else}
            <a class="btn btn-warning col-lg-2" href="{php echo createWebUrl('theme_softsn',array('op'=>'confirm','themeid'=>$themeid,'status'=>2));}">专版借用申请</a>
            <a class="btn btn-success col-lg-2" href="{php echo createWebUrl('theme_softsn',array('op'=>'confirm','themeid'=>$themeid,'status'=>3));}">专版误报申请</a>
            {/if}
        </div>
    </div>

</div>

<script type="text/javascript">
    //提交审核
    function applypost(type){
        let postUrl = "{php echo createWebUrl('exclusive_image',array('op'=>'apply_post','themeid'=>$themeid));}";
        let success_redirect = "{php echo createWebUrl('exclusive_image',array('op'=>'apply_display','themeid'=>$themeid,'type'=>1));}";
        var jsonObj = $.parseJSON('{php echo $item[res_json];}');
        $.ajax({
            url:postUrl,
            dataType:'json',
            method:'post',
            data:$.param({type:type,res_json:jsonObj})+'&'+jQuery('#form2').serialize(),
            success:function (e) {
                let res = e.result;
                let status = e.status;
                let msg = res.msg;
                if (status!=1){
                    layer.msg(msg)
                }else{
                    layer.msg(msg);
                    window.location.href = success_redirect;
                }
            },
            fail:function (err) {
                console.log(err)
            }
        })
    }

    // //审核通过
    function pass() {
        let postUrl = "{php echo createWebUrl('exclusive_image',array('op'=>'apply_pass','themeid'=>$themeid));}";
        let success_redirect = "{php echo createWebUrl('exclusive_image',array('op'=>'display','themeid'=>$themeid));}";
        let  item_id = $('#id').val();
        $.ajax({
            url:postUrl,
            dataType:'json',
            method:'post',
            data:{id:item_id},
            success:function (e) {
                let res = e.result;
                let status = e.status;
                let msg = res.msg;
                if (status!=1){
                    layer.msg(msg)
                }else{
                    layer.msg(msg);
                    window.location.href = success_redirect;
                }
            },
            fail:function (err) {
                console.log(err)
            }
        })
    }
    // //审核驳回
    function reject() {
        layer.confirm('确认审核不通过吗？', {
            btn : [ '确定', '取消' ]//按钮
        }, function(index) {
            let postUrl = "{php echo createWebUrl('exclusive_image',array('op'=>'apply_reject','themeid'=>$themeid));}";
            let success_redirect = "{php echo createWebUrl('exclusive_image',array('op'=>'display','themeid'=>$themeid));}";
            let item_id = $('#id').val();

            $.ajax({
                url:postUrl,
                dataType:'json',
                method:'post',
                data:{id:item_id},
                success:function (e) {
                    let res = e.result;
                    let status = e.status;
                    let msg = res.msg;
                    if (status!=1){
                        layer.msg(msg)
                    }else{
                        layer.msg(msg);
                        window.location.href = success_redirect;
                    }
                },
                fail:function (err) {
                    console.log(err)
                }
            })
            layer.close(index);
        });
    }




</script>
